package cn.stylefeng.guns.modular.demos.util;

public enum MyEnum {
     FREE("空闲", 0), MAP("分配", 1), GOT("领取", 2), ERROR("黄色", 3),TIMEOUT("黄色", 99);;
	 private String name;
	 private int status;
	 
	 // 构造方法
	    private MyEnum(String name, int status) {
	        this.name = name;
	        this.status = status;
	    }

	    // 普通方法
	    public static String getName(int status) {
	        for (MyEnum c : MyEnum.values()) {
	            if (c.getStatus() == status) {
	                return c.name;
	            }
	        }
	        return null;
	    }

	    // get set 方法
	    public String getName() {
	        return name;
	    }

	    public void setName(String name) {
	        this.name = name;
	    }

	    public int getStatus() {
	        return status;
	    }

	    public void setStatus(int status) {
	        this.status = status;
	    }
}
